package com.icode.core.model.house;

import com.icode.core.dto.house.ForEnumDTO;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-6-8
 * Time: 上午11:19
 * To change this template use File | Settings | File Templates.
 */
public enum HouseInfoStatus {

    BUY("购买房"),
    CHANGING("交换中"),
    CHANGED("交换房");
    private String label;

    private HouseInfoStatus(String label) {
        this.label = label;
    }

    public static List<String> getValues() {
        List<String> values = new ArrayList<>();
        for (HouseInfoStatus houseInfoStatus : HouseInfoStatus.values()) {
            String value = houseInfoStatus.name();
            values.add(value);
        }
        return values;
    }

    public String getValue() {
        return name();
    }

    public void setValue() {

    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public static List<ForEnumDTO> toDTOs() {
        List<ForEnumDTO> forEnumDTOs = new ArrayList<>();
        for (HouseType houseType : HouseType.values()) {
            String value = houseType.name();
            String label = houseType.getLabel();
            ForEnumDTO forEnumDTO = new ForEnumDTO(value, label);
            forEnumDTOs.add(forEnumDTO);
        }
        return forEnumDTOs;
    }

}
